package com.sailing.core.java.generics;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class MethodBridge {

    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        System.out.println("---------a-------");
        GenericesInterface agi = new GenericesInterfaceImpl();
        Method agim = GenericesInterfaceImpl.class.getMethod("call", String.class);
        agim.invoke(agi, "a");
        System.out.println(agim.isBridge());
        //
        System.out.println("---------b-------");
        GenericesInterface bgi = new GenericesInterfaceImpl();
        Method bgim = GenericesInterfaceImpl.class.getMethod("call", Object.class);
        bgim.invoke(bgi, "b");
        System.out.println(bgim.isBridge());
        //
    }
}
